package bankaccount;

abstract class BankAccount {
    private String accountNumber;
    private String accountHolder;
    private double balance;

    public BankAccount(String accountNumber, String accountHolder, double balance) {
        this.accountNumber = accountNumber;
        this.accountHolder = accountHolder;
        this.balance = balance;
    }

    public void deposit(double money){
        if(money>0){
            balance = balance + money;
            System.out.println("存入："+money+"钱");
        }
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public void withdraw(double money){
        if(money<0){
            balance = balance - money;
            System.out.println("取出："+money+"钱");
        }
    }

    public double getBalance(){
        return this.balance;
    }

    public abstract String accountType();
}
